package com.lanou.dllo.findfood.activity;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.CompoundButton;
import android.widget.Toast;

import com.lanou.dllo.findfood.MainActivity;
import com.lanou.dllo.findfood.R;
import com.lanou.dllo.findfood.receiver.MyReceiver;
import com.lanou.dllo.findfood.service.MyService;
import com.lanou.dllo.findfood.tools.UISwitchButton;

/**
 * Created by dllo on 15/11/8.
 */

public class SetActivity extends Activity implements CompoundButton.OnCheckedChangeListener {
    private UISwitchButton switchbtn;
    private  MyReceiver receiver;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_set);
        initView();
    }
  private  void   initView(){
      switchbtn = (UISwitchButton) findViewById(R.id.switchbtn);
      switchbtn.setOnCheckedChangeListener(this);
      receiver = new MyReceiver();
    }

    @Override
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
        switch (buttonView.getId()){
            case R.id.switchbtn:
                if (isChecked=true){
                    //receiver.myNotification();
                    }

                Toast.makeText(this,"点击了switch1"+isChecked, Toast.LENGTH_LONG).show();
            break;
            default:
                break;
        }
    }
}
